/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package logic;

/**
 *
 * @author phong
 */
public abstract class BasicType extends Type{

    @Override
    public boolean equals(Object o) {
        if (o instanceof BasicType)
            return ((BasicType)o).getName().equals(getName());
        else
            return false;
    }

    @Override
    public boolean matches(Type other) {
        return other.equals(Type.UNKNOWN_TYPE) || this.equals(other);
    }

    @Override
    public Type resolve(Type other) {
        if (this.matches(other))
            return this;
        return null;
    }

}
